# -*- coding:utf-8 -*-
"""
Created on 30/lug/2011

@author: Luigi Poderico
"""

class Resource:
    
    def __init__(self):
        self.theTransientFlag = False
        self.theWeightLoadCost = 0
        pass
    pass

#===============================================================================
# 
#===============================================================================

class Machine(object):
    def __init__(self):
        self.theNeighborhoodId = 0
        self.theLocationId = 0
        self.theCapacities = []
        self.theSafetyCapacties = []
        self.theMachineMoveCost = []
        pass
    pass

#===============================================================================
# 
#===============================================================================

class Service:
    def __init__(self):
        self.theSpreadMin = 1
        self.theDependingServices = []
        pass
    pass

#===============================================================================
# 
#===============================================================================

class Process:
    def __init__(self):
        self.theServiceId = 0
        self.theRequirements = []
        self.theProcessMovementCost = 0
        pass
    pass

#===============================================================================
# 
#===============================================================================

class BalanceObjective:
    def __init__(self):
        self.theResourceJ = -1
        self.theResourceK = -1
        self.theTarget = 0
        self.theWeightBalanceCost = 0
        pass
    pass

#===============================================================================
# 
#===============================================================================
class ProblemInstance:
    def __init__(self):
        self.theNumLocations = 0
        self.theNumNeighborhood = 0
        
        self.theResources = [] # List of Resource objects
        self.theMachines = [] # List of Machine objects
        self.theServices = []
        self.theProcesses = []
        self.theBalanceObjectives = []
        
        self.theWeightProcessMoveCost = 0
        self.theWeightServiceMoveCost = 0
        self.theWeightMachineMoveCost = 0
        pass
    
#------------------------------------------------------------------------------ 

    def getNumLocations(self): return self.theNumLocations
    def getNumNeighborhood(self): return self.theNumNeighborhood
    def getNumResources(self): return len(self.theResources)
    
#------------------------------------------------------------------------------ 

    def addNumbers(self, aNumLocations, aNumNeighborhood):
        self.theNumLocations = aNumLocations
        self.theNumNeighborhood = aNumNeighborhood
        pass
#------------------------------------------------------------------------------ 

    def addResources(self, aResourceList):
        self.theResources.extend(aResourceList)
        pass
#------------------------------------------------------------------------------ 

    def addMachines(self, aMachineList):
        self.theMachines.extend(aMachineList)
        pass
#------------------------------------------------------------------------------ 

    def addServices(self, aServiceList):
        self.theServices.extend(aServiceList)
        pass
#------------------------------------------------------------------------------ 

    def addProcess(self, aProcesses):
        self.theProcesses.extend(aProcesses)
        pass
    
#------------------------------------------------------------------------------ 

    def addBalanceObjectives(self, aBalanceObjectives):
        self.theBalanceObjectives.extend(aBalanceObjectives)
        pass
    
#------------------------------------------------------------------------------ 

    def addWeights(self, aProcessMoveCost, aServiceMoveCost,
                   aMachineMoveCost):
        self.theWeightProcessMoveCost = aProcessMoveCost
        self.theWeightServiceMoveCost = aServiceMoveCost
        self.theWeightMachineMoveCost = aMachineMoveCost
        pass
    
    pass #class
